#include "CompassItem.h"
#include <QPainter>
#include <QPixmap>

namespace TGS{
namespace MapControl{


CompassItem::CompassItem(const QString& compassFilePath)
{
	setCompassIcon(compassFilePath);
}


CompassItem::~CompassItem(void)
{
}

void CompassItem::paint( QPainter* painter, const QStyleOptionGraphicsItem*, QWidget* )
{
	const QRect rect(0, 0, 128, 128);
	painter->drawPixmap(rect, pixmap());
}

void CompassItem::setCompassIcon( const QString& compassFilePath )
{
	QPixmap pixmap(compassFilePath);
	this->setPixmap(pixmap);
}

//QRectF CompassItem::boundingRect() const
//{
//	return QRectF(0, 0, 128, 128);
//}

}//MapControl
}//TGS